:root {
  --primary-color: #4a90e2;
  --secondary-color: #50e3c2;
  --background: #f5f7fa;
  --text-primary: #2c3e50;
  --border-radius: 8px;
}



.script-area {
    width: 100%;
    height: 300px;
}

.execution-results {
    border: 1px solid #ddd;
    min-height: 150px;
    padding: 10px;
}



body {
    margin: 0;
    font-family: 'Segoe UI', system-ui, sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
}


/* 左侧样式 */
.flex-left {
    width: 280px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.button-group {
    display: grid;
    gap: 12px;
    margin-top: 20px;
}

.button-group button {
    padding: 12px 20px;
    border: none;
    background: var(--primary-color);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.button-group button:hover {
    background: #357abd;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.4);
}

.button-group button i {
    font-size: 14px;
    transition: transform 0.2s ease;
}

.button-group button:hover i {
    transform: scale(1.1);
}

/* 中间区域 */
.flex-middle {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.script-section {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    padding-block-end: 40px;
}

.script-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.script-header a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.script-header a:hover {
    text-decoration: underline;
}

.script-header button {
    margin-left: auto;
    padding: 8px 16px;
    border: 2px solid var(--primary-color);
    background: transparent;
    color: var(--primary-color);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.script-header button:hover {
    background: var(--primary-color);
    color: white;
}

.script-area {
    width: 100%;
    height: 300px;
    border: 2px solid #e0e0e0;
    border-radius: var(--border-radius);
    font-family: 'Fira Code', monospace;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    transition: border-color 0.3s ease;
}

.script-area:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
}

/* 执行区域 */
.execution-section {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.execution-section button {
    margin-left: auto;
    padding: 8px 16px;
    border: 2px solid var(--primary-color);
    background: transparent;
    color: var(--primary-color);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#command-input {
    width: 60%;
    height: 35px;
    margin: 15px 0;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.execution-results {
    background: #2c3e50;
    color: #e0e0e0;
    padding: 15px;
    border-radius: 6px;
    margin-top: 15px;
    font-family: 'Fira Code', monospace;
    white-space: pre-wrap;
    overflow-x: auto;
}


/* 右侧区域 */
.flex-right {
    width: 300px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#search-box {
    width: 100%;
    height: 35px;
    margin: 15px 0;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    transition: all 0.3s ease;
}

#search-box:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(80, 227, 194, 0.2);
    outline: none;
}


/* 版本选择 */
#version-select {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    appearance: none;
    background: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") no-repeat right 1rem center/1em;
}

input[type="checkbox"] {
    accent-color: var(--secondary-color);
    width: 16px;
    height: 16px;
    margin-right: 8px;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    width: 300px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.modal-content h3 {
    margin-top: 0;
    margin-bottom: 15px;
}

#customPromptInput {
    width: 100%;
    padding: 8px;
    margin-bottom: 15px;
    box-sizing: border-box;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal-buttons button {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

#promptCancelBtn {
    background-color: #f1f1f1;
}

#promptConfirmBtn {
    background-color: #4CAF50;
    color: white;
}

.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  transition: all 0.3s ease;
}

.toast-content {
  padding: 15px 25px;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  background-color: #333;
  color: white;
  display: flex;
  align-items: center;
  max-width: 300px;
  animation: slideIn 0.3s ease-out;
}

.toast.success {
  background-color: #4CAF50;
}

.toast.warning {
  background-color: #FF9800;
}

.toast.error {
  background-color: #F44336;
}

.toast.info {
  background-color: #2196F3;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* 提示框样式 */
.tooltip {
    position: absolute;
    background-color: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 14px;
    z-index: 100;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
    max-width: 200px;
    word-wrap: break-word;
}

/* *****************************************多值输入框CSS样式*****************************************    */

/* 模态框基础样式 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal-dialog {
  background: white;
  border-radius: 8px;
  width: min(90%, 500px);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  transform: translateY(-20px);
  transition: transform 0.3s ease;
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
}

.modal-body {
  padding: 20px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.btn {
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.btn-cancel {
  background: #f5f5f5;
  border: 1px solid #ddd;
}

.btn-submit {
  background: #4CAF50;
  color: white;
  border: none;
}

/* 错误状态 */
.error {
  border-color: red !important;
}

/* *****************************************树形CSS样式*****************************************    */


.tree {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.5;
}

.tree-node {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tree-node__item {
  padding: 8px 15px;
  cursor: pointer;
  transition: all 0.3s;
  border-radius: 4px;
  display: flex;
  align-items: center;
}

.tree-node__item:hover {
  background-color: #f5f5f5;
}

.tree-node__item--selected {
  background-color: #e3f2fd;
  color: #2196f3;
}

.tree-node__arrow {
  width: 20px;
  height: 20px;
  margin-right: 8px;
  transition: transform 0.3s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tree-node__arrow.collapsed {
  transform: rotate(-90deg);
}

.tree-node__content {
  display: flex;
  align-items: center;
  flex: 1;
}

.tree-node__label {
  margin-left: 5px;
}

.tree-node__children {
  margin-left: 24px;
  overflow: hidden;
  transition: height 0.3s;
}

.tree-node__children.collapsed {
  height: 0 !important;
}

.tree-node__icon {
  color: #78909c;
  margin-right: 8px;
}

/* *****************************************自定义选项CSS样式*****************************************    */
.custom-options-panel {
  margin: 20px 0;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 5px;
  border: 1px solid #e1e4e8;
}

.options-title {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 16px;
  color: #24292e;
}

.options-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  background: white;
  border-radius: 4px;
  border: 1px solid #e1e4e8;
}

.option-item label {
  margin-left: 8px;
  flex-grow: 1;
  cursor: pointer;
}

.option-item input[type="checkbox"] {
  cursor: pointer;
}

/* *****************************************出现滚动条并且滚动条优化CSS样式*****************************************    */

.tree {
  max-height: 400px;
  overflow-y: auto;
  scrollbar-width: thin; /* Firefox */
}

/* Chrome/Safari滚动条美化 */
.tree::-webkit-scrollbar {
  width: 8px;
}

.tree::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.tree::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

.tree::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* *****************************************搜索高亮CSS样式*****************************************    */

.tree-node__highlight {
  background-color: #ffeb3b;
  color: #000;
  padding: 0 2px;
  border-radius: 3px;
}

/* *****************************************绘图CSS样式*****************************************    */

.view-container {
  overflow: hidden;
  width: 100%;
  height: 350px;
}

.script-area {
  width: 100%;
  height: calc(100% - 20px);
  font-family: monospace;
  padding: 10px;
  box-sizing: border-box;
}

.graph-area {
  width: calc(100% - 10px);
  height: calc(100% - 23px);
  border: 1px solid #ddd;
  background-color: #f9f9f9;
  overflow: hidden; /* 防止滚动条影响缩放 */
}


/* scriptOperate.css - 精简版（配合JS控制方案） */

/* 基础交互样式（必须保留） */
.link {
  cursor: pointer;  /* 连线可交互 */
  pointer-events: visibleStroke; /* 优化连线点击区域 */
  transition: stroke 0.2s ease, stroke-width 0.2s ease;
}

.node circle {
  cursor: pointer;  /* 节点可拖拽 */
}

/* 文本样式（必须保留） */
.node text {
  font-size: 10px;
  font-family: sans-serif;
  text-anchor: middle;
  pointer-events: none;  /* 禁止文本拦截鼠标事件 */
  user-select: none;     /* 禁止文本选中 */
}

/* 过渡效果（可选） */
.link, .node circle {
  transition: all 0.3s ease; /* 如果JS中未设置transition可保留 */
}


/* 高亮状态的额外类（可通过JS动态添加） */
.highlighted {
  stroke: #ff7f0e !important;
  stroke-width: 4px;
}

/* 缩放容器 */
.zoom-container {
  width: 100%;
  height: 100%;
}

/* *****************************************语法提示CSS样式*****************************************    */

/* 提示星号样式 */
.hint-asterisk {
  color: #888;
  font-size: 14px;
  cursor: help;
  position: relative;
  display: inline-block;
  margin-left: 5px;
}

/* 提示框容器 - 新增包装层 */
.hint-container {
  position: relative;
  display: inline;
}

/* 完美定位的提示框 */
.hint-asterisk:hover::after {
  content: "## 事物定义语义\A// 定义一个事物，国家，代表任意一个国家\Aobject 国家  省份 城市\A\A## 关系定义语义\Arelation 包含(A,B)\A[包含]:A->B=[0,) //代表 针对任意一个A，都可以找到 [0,)个B与之对应\A[被包含]:B->A=1  //代表 针对任意一个B，都可以找到 1个A与之对应\A\A## 关系实例化语句\A包含(国家,省份)    \A包含(省份,城市)\A\A## 映射构建语句\A// 固定值映射\A buildMap((sourceObj,destObj),(node2,value),(node3,value))\A// 常量映射，无论来源事物是什么，输出都是 constValue \A buildConstMap((sourceObj,destObj),constValue)\A// 来源事物映射，输出 sourceBObj事物对应的值\A buildEqualMap((sourceAObj,sourceBObj,destObj),sourceBObj)\A\A## 单个语义网络内概念融合语句\A conceptMerge((fromSource1,,,fromDest),(toSource1,,,toDest))\A\A## 关系不变情况下，增加中间事物，暂时仅支持来源事物数量为1\A addObjBwRelation((source1,dest),(middleRangeObj1,,,))";
  white-space: pre-wrap;
  position: fixed; /* 改为fixed定位，不受父容器限制 */
  left: 50%;
  bottom: auto;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(120vw, 450px);
  max-height: min(100vh, 600px);
  padding: 15px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  z-index: 9999;
  font-size: 13px;
  line-height: 1.6;
  color: #333;
  overflow-y: auto;
  overflow-x: hidden;
}

/* 滚动条样式增强 */
.hint-asterisk:hover::after {
  scrollbar-width: auto;
  scrollbar-color: #bbb #f8f8f8;
}

.hint-asterisk:hover::after::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.hint-asterisk:hover::after::-webkit-scrollbar-track {
  background: #f8f8f8;
  border-radius: 5px;
}

.hint-asterisk:hover::after::-webkit-scrollbar-thumb {
  background: #bbb;
  border-radius: 5px;
  border: 2px solid #f8f8f8;
}

.hint-asterisk:hover::after::-webkit-scrollbar-thumb:hover {
  background: #999;
}


/* *****************************************标题栏*****************************************    */
html,body{
    height: 100%;
}

/***滚动条样式 徐经欢 2025-04-25 add start**/
::-webkit-scrollbar {
    /*滚动条整体样式*/
    width : 12px;  /*高宽分别对应横竖滚动条的尺寸*/
    height: 12px;
}
::-webkit-scrollbar-thumb {
    /*滚动条里面小方块*/
    border-radius   : 10px;
    background-color: #9081ed;
    background-image: -webkit-linear-gradient(
            45deg,
            rgba(255, 255, 255, 0.2) 25%,
            transparent 25%,
            transparent 50%,
            rgba(255, 255, 255, 0.2) 50%,
            rgba(255, 255, 255, 0.2) 75%,
            transparent 75%,
            transparent
    );
}
::-webkit-scrollbar-track {
    /*滚动条里面轨道*/
    box-shadow   : inset 0 0 5px rgba(0, 0, 0, 0.2);
    background   : #ededed;
    border-radius: 10px;
}

.container {
  display: flex;
  flex-direction: column; /* 改为垂直排列 */
  height: calc(100% - 20px);/**徐经欢 2025-04-25 update 为了避免整体框架动，滚动条过多，修改此参数*/
  gap: 15px;
  padding: 10px;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}


.flex-left {
  width: 10%;
  border-right: 1px solid #ccc;
  padding: 10px;
}

.flex-left .tree{
    max-height: 1000px;
  height: calc(100% - 388px);
}

.flex-middle {
  width: 75%;
  border-right: 1px solid #ccc;
  height: 100%; /*徐经欢 2025-04-25 update 修改中间高度，保证滚动条可以滚动*/
  overflow-y: auto;/*徐经欢 2025-04-25 update 修改中间高度，保证滚动条可以滚动*/
}

.flex-right {
  width: 15%;
  padding: 10px;
  overflow: auto;
}

.title-bar {
  background: linear-gradient(135deg, #6e8efb, #a777e3);
  color: white;
  padding: 10px 15px;
  height: 30px;  /* 移动端更小高度 */
  cursor: pointer;
  border-radius: 4px 4px 0 0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
}
.title-bar:hover {
  background: linear-gradient(135deg, #5b7cf6, #9a6ad8);
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
.title-bar h1 {
  margin: 0;
  font-size: 1.5em;
  font-weight: 500;
  text-align: left;
}

/* 内容区域改为水平排列 */
.content-area {
  display: flex;
  flex: 1;
  gap: 15px;
  overflow: hidden;
}